<include file="Public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
  <include file="Public/breadcrumb"/>
	<section class="content">
       <div class="row">
       		<div class="col-xs-12">
	       		<div class="box">
					 <div class="box-header">
					   <h3 class="box-title">日志列表</h3>
					 </div>
					<div class="navbar navbar-default">
						<form action="" id="search-form2" class="navbar-form form-inline" method="post" onsubmit="return false">

							<div class="form-group">
								<div class="input-group">
									<input type="text" name="log_content" value="" placeholder="事件" id="log_content" class="form-control">
								</div>
								<div class="input-group">
									<input type="text" name="name" value="" placeholder="商家名称" id="name" class="form-control">
								</div>
								<div class="form-group">
									<div class="input-group">
										<input type="text" name="timegap" value="{$timegap}" placeholder="日期"  id="add_time" class="input-sm" style="width: 220px;">
									</div>
								</div>
								<div class="form-group">
									<button type="submit" onclick="ajax_get_table('search-form2',1,0)" id="button-filter search-order" class="btn btn-primary pull-right"><i class="fa fa-search"></i> 筛选</button>
								</div>
							</div>
						</form>
					</div>
	          </div>

				<div id="ajax_return">

				</div>

	        </div>
       	</div>
       </div>
   </section>
</div>
<script>
	$(document).ready(function(){
		ajax_get_table('search-form2',1,0);
		$('#add_time').daterangepicker({
			format:"YYYY-MM-DD HH:mm",
			singleDatePicker: false,
			showDropdowns: true,
			minDate:'2021-01-01 00:00',
			maxDate:'2030-01-01 00:00',
			startDate:'{:date("Y-m-d")} 00:00',
			showWeekNumbers: true,
			timePicker: true,
			timePickerIncrement: 1,
			timePicker12Hour: false,
			opens: 'right',
			buttonClasses: ['btn btn-default'],
			applyClass: 'btn-small btn-primary',
			cancelClass: 'btn-small',
			locale : {
				applyLabel : '确定',
				cancelLabel : '取消',
				fromLabel : '起始时间',
				toLabel : '结束时间',
				customRangeLabel : '自定义',
				daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
				monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
				firstDay : 1
			}
		});
	});
	// ajax 抓取页面
	function ajax_get_table(tab,page,number){
		cur_page = page; //当前页面 保存为全局变量
		$.ajax({
			type : "POST",
			url:"/index.php/Admin/Admin/ajaxsellerlog/p/"+page+"/n/"+number,//+tab,
			data : $('#'+tab).serialize(),// 你的formid
			success: function(data){
				$("#ajax_return").html('');
				$("#ajax_return").append(data);
			}
		});
	}
	// 点击排序
	function sort(field)
	{
		$("input[name='order_by']").val(field);
		var v = $("input[name='sort']").val() == 'desc' ? 'asc' : 'desc';
		$("input[name='sort']").val(v);
		ajax_get_table('search-form2',cur_page,0);
	}
function delfun(obj){
	//询问框
layer.confirm('确认删除？', {
  btn: ['确定','取消'] //按钮
}, function(){
    // 确定
		$.ajax({
			type : 'post',
			url : $(obj).attr('data-url'),
			data : {act:'del',log_id:$(obj).attr('data-id')},
			dataType : 'json',
			success : function(data){
				if(data==1){
					$(obj).parent().parent().remove();
				}else{
					layer.msg(data, {icon: 2,time: 2000});   //alert(data);
				}
			}
		})
}, function(){
	// 取消
});
	return false;
}
</script>  
</body>
</html>